#include "StdAfx.h"
#include "MioString.h"


using namespace mio;
using std::string;
using std::vector;

TEST(MioStringTest, split)
{
	StringUtil util;
	string content = "this is line1.\r\nthis is line2.\n\r\n";
	vector<string> split = util.split(content, "\n\r");
	EXPECT_EQ(2, split.size());
	EXPECT_STREQ("this is line1.", split[0].c_str());
	EXPECT_STREQ("this is line2.", split[1].c_str());

	content = "mtllib red";
	split = util.split(content, " \r\n\t");
	EXPECT_EQ(2, split.size());
	EXPECT_STREQ("mtllib", split[0].c_str());
	EXPECT_STREQ("red", split[1].c_str());
}
